import request from '@/utils/request'
import {
  urlParam
} from '@/utils/index'

export function getQuestionInfoList(query) {
  if (query.time && query.time.length) {
    query.startTime = query.time[0]
    query.endTime = query.time[1]
  } else {
    query.startTime = ''
    query.endTime = ''
  }
  return request.get('/statistical/getQuestionInfoList?'+ urlParam(query))
}

export function getUserQuestionInfoList(query) {
  if (query.time && query.time.length) {
    query.startTime = query.time[0]
    query.endTime = query.time[1]
  } else {
    query.startTime = ''
    query.endTime = ''
  }
  return request.get('/statistical/getUserQuestionInfoList?'+ urlParam(query))
}

export function getQuestionInfoUseInfo(query) {
  return request.get('/statistical/getQuestionInfoUseInfo?'+ urlParam(query))
}

export function getQuestionSetByUser(query) {
  return request.get('/statistical/getQuestionSetByUser?'+ urlParam(query))
}

export function updateQuestionInfo() {
  return request.get('/statistical/initQuestion')
}